
/****** Object:  Table [dbo].[CompanyPerson]    Script Date: 07/26/2011 21:57:16 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[CompanyPerson](
	[CompanyId] [int] NOT NULL,
	[PersonId] [int] NOT NULL,
 CONSTRAINT [PK_CompanyPerson] PRIMARY KEY CLUSTERED 
(
	[CompanyId] ASC,
	[PersonId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[CompanyPerson]  WITH CHECK ADD  CONSTRAINT [FK_CompanyPerson_Company] FOREIGN KEY([CompanyId])
REFERENCES [dbo].[Company] ([Id])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[CompanyPerson] CHECK CONSTRAINT [FK_CompanyPerson_Company]
GO

ALTER TABLE [dbo].[CompanyPerson]  WITH CHECK ADD  CONSTRAINT [FK_CompanyPerson_Person] FOREIGN KEY([PersonId])
REFERENCES [dbo].[Person] ([Id])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[CompanyPerson] CHECK CONSTRAINT [FK_CompanyPerson_Person]
GO


